<!DOCTYPE HTML>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <meta name="_csrf" th:content="${_csrf.token}"/>
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>

    <title>在线订购 - .</title>
    <script type="text/javascript" src="../../assets/public/js/wfdq.js"></script>
    <script type="text/javascript" src="../../assets/public/js/wffh.js"></script>
    <script type="text/javascript" src="../../assets/public/js/wfgd.js"></script>
    <script src="../../assets/javascripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">wfFocus.set({id:'wffahuo',pattern:'wffahuo',time:3});</script>
    <script type="text/javascript">

        function Malert(content) {
            $("#_alert_content").text(content);
            $("#_alert_bg").show();
            $("#_alert_content").show();
        }
        $("document").ready(function () {

            //清除
            $("#wfproduct").val('');
            $("#wfproductb").val('');

            $("#_alert_bg").click(function () {
                $("#_alert_bg").hide();
                $("#_alert_content").hide();
            });
            $(".sku_ul a").click(function () {
                var o = $(this);

                if (!o.hasClass("sku_cur")) {  //点击不是当前已经选中的
                    $(".sku_cur").removeClass("sku_cur");
                    o.addClass("sku_cur");
                    $("#item_num").val(1);
                    $("#showprice").html(o.attr("data-price"));
                    $("#wfpricetemp").val(o.attr("data-price"));
                    $("#wfprice").val(o.attr("data-price"));
                    $("#wfproduct").val(o.attr("data-sku"));
                }
            });

            $(".sku_ul_na a").click(function () {
                var o = $(this);
                if (!o.hasClass("skuna_cur")) {   //点击不是当前已经选中的
                    $(".skuna_cur").removeClass("skuna_cur");
                    o.addClass("skuna_cur");
                    $("#wfproductb").val(o.attr("data-xh"));
                }
            });

            $(".sku_ul_nb a").click(function () {
                var o = $(this);
                if (!o.hasClass("skunb_cur")) {    //点击的不是当前已经选中的
                    $(".skunb_cur").removeClass("skunb_cur");
                    o.addClass("skunb_cur");
                    $("#wfproductc").val(o.attr("data-yc"));
                }
            });

        });

        function toushu(){

            var wfggref =    document.getElementById("wfggref").value;
            var wfproname =    document.getElementById("wfproname").value;
            var WFLLURL =    encodeURI(document.getElementById("WFLLURL").value);
            //window.location.href ="/index.php/Home/Common/toushu/wfggref/" + wfggref + "/wfproname/" + wfproname + "/WFLLURL/" + WFLLURL;
            window.location.href ="/index.php?m=Home&c=Common&a=toushu&wfggref=" + wfggref + "&wfproname=" + wfproname + "&WFLLURL=" + WFLLURL;

        }
        function numAdd(){
            var num_add = parseInt($("#item_num").val())+1;
            if($("#item_num").val()==""){
                num_add = 1;
            }
            $("#item_num").val(num_add);
            var total = parseFloat($("#wfpricetemp").val())*parseInt($("#item_num").val());
            $("#showprice").html(total);
            $("#wfprice").val(total);
        }
        function numDec(){
            var num_dec = parseInt($("#item_num").val())-1;
            if(num_dec<1){
                alert("数量不能小于1件！");
            }else{
                $("#item_num").val(num_dec);
                var total = parseFloat($("#wfpricetemp").val())*parseInt($("#item_num").val());
                $("#showprice").html(total);
                $("#wfprice").val(total);
            }
        }
    </script>
    <link href="../../assets/public/style/wfwap2style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="_alert_bg" style="display:none">
    <div id="_alert_content"></div>
</div>
<form id="wfform" name="wfform"  target="_parent">

    <input type="hidden" name = "priceid" th:value="${prices[0].id}" />
    <input type="hidden" name ="style" th:value="${styles[0].name}"/>
    <input type="hidden" name ="pid" th:value="${product.id}"/>
    <input type="hidden" name ="referral" th:value="${param.code}"/>
    <section class="item_sec">
        <div class="item_wrap rel">
            <img src="http://res1.shuangpengjiaju.com/Public/img/76947.jpg" height="" width="100%" />
            <p>7、若需咨帮助，请联系我们的客服。复制添加vk客服微信<span style="font-size: 16px; color: rgb(255, 0, 0);">VK-kf888</span> </p>
            <p class="item_pay"></p>
            <ul class="sku_ul"   ><li th:each="p,index:${prices}" th:onclick="'javascript:doprice(this,'+${p.id}+');'"><a href="javascript:void(0);" class="" data-price="198元" data-sku="买1条"  th:text="${p.name+'¥' + p.price}"></a></li></ul>

            <ul class="sku_ul_na" ><li th:each="s,idx:${styles}" onclick="dostyle(this)"><a href="javascript:void(0);" class="" data-xh="L"  th:text="${s.name}">L</a></li></ul>
        </div>
    </section>
    <section class="item_sec">
        <div class="item_wrap add">
            <p class="row">
                <label for="name">收货人</label>
                <input id="name" name="wfname" class="block input" value="" tabindex="1" type="text">
            </p>
            <p class="row">
                <label for="wfmob">联系手机</label>
                <input id="wfmob" name="wfmob" maxlength="11" class="block input" value="" tabindex="2" type="tel">
            </p>
            <p class="row">
                <label for="wfprovince">选择地区</label>
                <select class="select" id="wfprovince" name="wfprovince" tabindex="3"></select>
                <select class="select" id="wfcity" name="wfcity" tabindex="4"></select>
                <select class="select" id="wfarea" name="wfarea" tabindex="5" style="margin:0;"></select>
            </p>
            <p class="row row_area">
                <label for="address">详细地址</label>
                <input id="address" name="wfaddress" class="block input" value="" placeholder="街道门牌信息" tabindex="6" type="text">
            </p>
            <p class="row row_area">
                <label for="other">客户留言</label>
                <input id="other" name="wfguest" class="block input" tabindex="7" type="text" value="">
            </p>
            <p class="row row_area">
                <label for="other">付款方式</label>
                <span class="paybr"><input type="radio" name="wfpay" id="wfpay1" checked value="cod" onclick="wftgp();wfpaydiv(0);"><label for="wfpay1"><img src="../../assets/public/img/fka.gif" disabled></label></span>
            </p>

        </div>
    </section>
    <footer>
        <input type="button" onclick="dosub()" name="wfsubmit" class="c_txt orange_bg" value="立即提交订单" id="buy_now">
    </footer>
    <br><br>
    <div >
        <ul >
            <li style=" float:left;width:73px;    text-align:center; line-height:30px;"><a href="/www/tousu">投诉</a></li>
            <li style=" float:right;width:73px;     text-align:center; line-height:30px;" ><a href="/www/kefu">客服</a></li>
        </ul>
    </div>
    <br><br>
    <div id="wffahuo" class="wffahuo">
        <ul class="wffhlist">
            <!doctype html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <meta name="Generator" content="EditPlus®">
                <meta name="Author" content="">
                <meta name="Keywords" content="">
                <meta name="Description" content="">
                <title>Document</title>
            </head>
            <body>
            <script type="text/javascript">
                Date.prototype.format = function(format){
                    var o = {
                        "M+" : this.getMonth()+1, //month
                        "d+" : this.getDate(), //day
                        "h+" : this.getHours(), //hour
                        "m+" : this.getMinutes(), //minute
                        "s+" : this.getSeconds(), //second
                        "q+" : Math.floor((this.getMonth()+3)/3), //quarter
                        "S" : this.getMilliseconds() //millisecond
                    }

                    if(/(y+)/.test(format)) {
                        format = format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
                    }

                    for(var k in o) {
                        if(new RegExp("("+ k +")").test(format)) {
                            format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
                        }
                    }
                    return format;
                }
                //使用方法
                var now = new Date();
                var nowStr = now.format("yyyy-MM-dd");
                document.write("<li><span>"+nowStr+"</span><span>内蒙古的萧**</span><span>［180****3051］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>福建的罗*</span><span>［178****4603］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li><span>"+nowStr+"</span><span>新疆的韩*</span><span>［135****8687］</span><br>您订购的 <font class='green'>买2送1 ￥396元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>云南的林**</span><span>［151****1238］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li><span>"+nowStr+"</span><span>北京的胡**</span><span>［184****3365］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>海南的卢**</span><span>［158****1306］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li><span>"+nowStr+"</span><span>北京的周*</span><span>［177****4644］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>浙江的罗*</span><span>［183****6569］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li><span>"+nowStr+"</span><span>江苏的黄*</span><span>［136****8513］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>四川的袁**</span><span>［177****8717］</span><br>您订购的 <font class='green'>买3送2 ￥594元</font> 已发货！</li><li><span>"+nowStr+"</span><span>海南的贾*</span><span>［184****9079］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>山西的林**</span><span>［158****7395］</span><br>您订购的 <font class='green'>买2送1 ￥396元</font> 已发货！</li><li><span>"+nowStr+"</span><span>北京的郭*</span><span>［157****4862］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>四川的曹**</span><span>［185****3778］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li><span>"+nowStr+"</span><span>宁夏的董*</span><span>［155****8952］</span><br>您订购的 <font class='green'>买2送1 ￥396元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>四川的薛**</span><span>［138****3016］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li><span>"+nowStr+"</span><span>福建的朱*</span><span>［152****9976］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>北京的马*</span><span>［177****6367］</span><br>您订购的 <font class='green'>买2送1 ￥396元</font> 已发货！</li><li><span>"+nowStr+"</span><span>江苏的曾*</span><span>［131****5492］</span><br>您订购的 <font class='green'>买2送1 ￥396元</font> 已发货！</li><li class='ybg'><span>"+nowStr+"</span><span>江西的刘**</span><span>［159****6155］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li><li><span>"+nowStr+"</span><span>吉林的黄*</span><span>［135****6995］</span><br>您订购的 <font class='green'>买1条 ￥198元</font> 已发货！</li>");

                function dosub() {
                    event.stopPropagation();
                    if (bdpostcheck()){

                        var addr = $('#wfprovince').val() +
                            $('#wfcity').val() +
                            $('#wfarea').val() +
                            $("#address")[0].value;


                        var data = {
                            stylename: $("input[name='style']").val(),
                            mobile: $('#wfmob').val(),
                            username: $('#name').val(),
                            addr: addr,
                            priceid: $("input[name='priceid']").val(),
                            productid: $('input[name="pid"]').val(),
                            message:$('#other').val(),
                            referral:$('input[name="referral"]').val()
                        }

                        $.ajax("/www/addOrder", {data: data})
                            .done(function (res) {

                                alert("购买成功！");

                                $('#buy_now').val("立即提交订单");
                                $('#wfform')[0].reset();
                            })
                            .fail(function (res) {
                                alert("error");
                            })
                    }else{
                        return false;
                    }
                }

                function dostyle(o){

                    $("input[name='style']").val($(o).text());


                }
                function doprice(o,id){


                    $("input[name='priceid']").val(id);
                }

            </script>


            </body>
            </html>


        </ul>
    </div>
</form>
<script type="text/javascript" src="../../assets/public/js/bd.js"></script>
</body>
</html>